import { _decorator, Button, Component, Label, View } from "cc";
import BaseView from "../../../framework/ui/BaseView";
import { gameData } from "../../data/GameData";
import { bindNode, SearchType, uiview } from "../../../framework/ui/UIDecorator";

const { ccclass ,property} = _decorator;


@ccclass("GameInfoView")
export class GameInfoView extends BaseView{


    @bindNode("info/Label")
    labelNode:Node

    @bindNode("info/Label",Label)
    infoLabel:Label
    
    @bindNode("",Button,SearchType.Children)
    btns:Button[]

    protected init(): void {
        // this.infoLabel = this.node.getChildByName("Label").getComponent(Label)
        this.useAnimation = false;
        console.log(this.btns.length);
        
    }

    protected show(...args: any[]): void {
        this.addEffect(()=>{
            this.infoLabel.string = gameData.nowTime.value+"_"+gameData.clientVersion.value+"_"+gameData.playerUid.value
        })
        console.log(this.node.getWorldPosition());
        
    }

}